home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Form / Sources / View.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  3.9 KB  |  128 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FormView.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FORMVIEW_H
  11. #define FORMVIEW_H
  12.  
  13. #ifndef DEFINES_K
  14. #include "Defines.k"
  15. #endif
  16.  
  17. #ifndef FWPICTSV_H
  18. #include "FWPictSv.h"
  19. #endif
  20.  
  21. #if FW_PPOB_VIEWS
  22. #include "FWPPobOb.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. // Forward Declaration
  27. //========================================================================================
  28.  
  29. class CFormPart;
  30. class FW_CViewContext;
  31. class FW_CMouseEvent;
  32. class FW_CRadioCluster;
  33. class FW_CListBox;
  34.  
  35. //========================================================================================
  36. // CFormView
  37. //========================================================================================
  38. // Implementation of a content view drawing a background picture
  39.  
  40. class CFormView : public FW_CPictSView
  41. {
  42. public:
  43.     FW_DECLARE_CLASS
  44.     FW_DECLARE_AUTO(CFormView)
  45.  
  46. public:        
  47.     CFormView(Environment *ev, 
  48.                         FW_CSuperView* container, 
  49.                         const FW_CRect& bounds,
  50.                         FW_ResourceID pictID1,
  51.                         FW_ResourceID pictID2);
  52.     virtual ~ CFormView();
  53.  
  54. private:
  55.     CFormView(Environment *ev);
  56.  
  57. //----------------------------------------------------------------------------------------
  58. // Inherited API
  59. public:        
  60.     virtual void                 Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  61.     virtual void                 AdjustToNewLayout(Environment *ev, const FW_CPoint& oldExtent, 
  62.                                             const FW_CPoint& newExtent, FW_ERedrawVerb redraw);
  63.  
  64.     virtual FW_Handled         DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  65.  
  66.     virtual void                 PostCreateViewFromStream(Environment* ev);
  67.     virtual void                 CreateSubViews(Environment* ev);
  68.  
  69.     virtual void                 ActivateTarget(Environment* ev, FW_Boolean tabSelection);
  70.     
  71.     // ----- Archiving -----
  72. #if FW_ODFRC_VIEWS
  73.     static void*                Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  74.     static void                    Destroy(void* object, FW_ClassTypeConstant type);
  75.     virtual void                Flatten(Environment* ev, FW_CWritableStream& stream) const;
  76.     virtual void                InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  77. #endif
  78.  
  79. //----------------------------------------------------------------------------------------
  80. //    New API
  81. public:
  82.     void                         CenterInFrame(Environment* ev, FW_CPoint& size, FW_ERedrawVerb redraw);
  83.     
  84.     void                         SwitchForm(Environment* ev);
  85.     void                         DrawUserData(Environment *ev, FW_CViewContext& vc);
  86.     void                         ResetData(Environment *ev);
  87.  
  88. private:
  89.     void                         InitializePict(Environment* ev, FW_ResourceID pictID);
  90.     
  91. //----------------------------------------------------------------------------------------
  92. //    Private data
  93.  private:
  94.      FW_Boolean                    fFirstFormOn;    // switch between 2 kind of forms
  95.      FW_CPicture                    fPicture2;
  96. };
  97.  
  98. //========================================================================================
  99. //    class CMouseUpBehavior
  100. //========================================================================================
  101. // See comments in .cpp file
  102.  
  103. class CMouseUpBehavior : public FW_MEventHandler
  104. {
  105. public:
  106.     FW_DECLARE_AUTO(CMouseUpBehavior)
  107.  
  108.     CMouseUpBehavior(Environment* ev, FW_CListBox* listBox);
  109.     virtual ~CMouseUpBehavior();
  110.  
  111. public:
  112.     virtual FW_Handled    DoMouseUp(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  113.     
  114. private:
  115.     FW_CListBox*        fListBox;
  116. };
  117.  
  118. //========================================================================================
  119. // MetroWerks Constructor View Resource Reader
  120. //========================================================================================
  121. #if FW_PPOB_VIEWS
  122.  
  123. void ReadFormView (Environment* ev, FW_CPPobReader* context, FW_CReadableStream& stream);
  124.  
  125. #endif // FW_PPOB_VIEWS
  126.  
  127. #endif // FORMVIEW_H
  128.